import QtQuick 2.2
import QtQuick.Window 2.1
import QtQuick.Controls 1.2

Window {
    visible: true
    width: 360
    height: 360

    Rectangle {
        anchors.fill: parent;
        gradient: Gradient{
            GradientStop {
                position: 0.0;
                color: "lightskyblue";
            }

            GradientStop {
                position: 1.0;
                color: "skyblue";
            }
        }

        Image {
            id: img;
//            width: 200;
//            height: 200;

//            paintedWidth: 1024;
//            paintedHeight: 1024;
            anchors.fill: parent;
            fillMode: Image.PreserveAspectFit;
            asynchronous: true;
            source: "http://images.china.cn/attachement/png/site1000/20140505/e89a8ffb139314d18bfa0b.png";

            onStatusChanged: {
                console.log("busy z: " + busy.z);
                console.log("img z: " + img.z);
            }
        }

        BusyIndicator {
            id: busy;
            anchors.centerIn: parent;
            //写的很粗糙
            running: img.status != Image.Ready;
        }

    }
}
